<template>
    <div class="content1">
<!--      <news-items></news-items>-->
       <div class="message">
           <!-- <h3 style="margin-left: 20px;text-align: left">新闻</h3> -->
           <hr>
         <!-- 新闻 -->
         <div class="lunbotu2">
           <!--        <el-carousel trigger="click" height="200px">-->
           <!--          <el-carousel-item v-for="item in List" :key="item">-->
           <!--            <h3 class="small">-->
           <!--              <router-link :to="item.nId?{name:'newsDetail',query:{nId:item.nId,nClass:item.nClass}}:{path:$route.fullPath}"><img :src="item.nPic" style="height: 200px"></router-link>-->
           <!--            </h3>-->
           <!--          </el-carousel-item>-->
           <!--        </el-carousel>-->
           <el-carousel height="150px" trigger="click">
<!--             <el-carousel-item v-for="item in 4" :key="item">-->
<!--               <h3 class="small">{{ item }}</h3>-->newsDetail
<!--             </el-carousel-item>-->
                   <el-carousel-item v-for="(o,index) in news" :key="index">
                     <h3 class="small">
<!--                       <router-link :to="item.nId?{name:'',query:{nId:item.nId,nClass:item.nClass}}:{path:$route.fullPath}"><img :src="item.pic" style="height: 200px"></router-link>-->
                       <router-link :to="{name:'newsDetail',query:{title:o.title,date:o.createAt,author:o.authorId,content:o.content}}"><img :src="o.pic" style="height: 200px"></router-link>
                     </h3>
                   </el-carousel-item>
           </el-carousel>
         </div>
<!--         这还要改-->
         <div class="news-item" style="border: 1px solid #5293cd">
           <div class ="mainContent">
             <!-- <p style="color: #5293cd">显示大字！</p>
             <p>写死的新闻！！！！</p> -->

           </div>
           <div v-for="(o,index) in news" :key="index">
               <img src="@/assets/img/arrow.gif" width="15" height="11" style="margin-bottom:3px;">
               <el-link type="info" :underline="false" style="margin-bottom:10px;">
                   <router-link :to="{name:'newsDetail',query:{title:o.title,date:o.createAt,author:o.authorId,content:o.content}}" class="router" style="text-decoration: none;">[{{o.title}}]</router-link>
               </el-link>
           </div>
<!--           <div class="more" style="bottom: 0">-->
<!--               <img class="click2" src="@/assets/img/pic050.gif" alt="" />-->
<!--               <span><a href="/#/news">更多...</a></span>-->
<!--           </div>-->
           <!-- //视频盒子
           <div class="vidioItem">
             <a href="www.baidu.com">
              <img src="http://i.weather.com.cn/images/cn/video/lssj/2023/04/21/202304211849596DF0575A1355CE4B4EBBFF45D1CE8357_m.png" alt="航空气象重点开放实验室成立" title="航空气象重点开放实验室成立" width="200" height="113">
             </a>
           </div> -->
         </div>
       </div>

<!--        &lt;!&ndash; 通知 &ndash;&gt;-->
<!--        <div class="message">-->
<!--            <h3 style="margin-left: 20px">通知</h3>-->
<!--            <hr>-->
<!--            <div v-for="(o,index) in notice" :key="index">-->
<!--                <img src="@/assets/img/arrow.gif" width="15" height="11" style="margin-bottom:3px;">-->
<!--                <el-link type="info" :underline="false" style="margin-bottom:10px;">-->
<!--                    <router-link :to="{name:'newsDetail',query:{nId:o.nId,nClass:o.nClass}}" style="text-decoration: none;color: black;font-size:12px;font-family:'黑体';">[{{o.nDate}}] {{o.nTitle}}</router-link>-->
<!--                </el-link>-->
<!--            </div>-->
<!--            <div style="position:absolute;bottom: 0">-->
<!--                <img class="click" src="@/assets/img/pic050.gif" alt="" />-->
<!--                <span><a href="/#/notice">更多...</a></span>-->
<!--            </div>-->
<!--       </div>-->

<!--        &lt;!&ndash; 重要信息 &ndash;&gt;-->
<!--       <div class="message">-->
<!--            <h3 style="margin-left: 20px">重要信息</h3>-->
<!--            <hr>-->
<!--            <div v-for="(o,index) in information " :key="index">-->
<!--                <img src="@/assets/img/arrow.gif" width="15" height="11" style="margin-bottom:3px;">-->
<!--                <el-link type="info" :underline="false" style="margin-bottom:10px;">-->
<!--                    <router-link :to="{name:'newsDetail',query:{nId:o.nId,nClass:o.nClass}}" style="text-decoration: none;color: black;font-size:12px;font-family:'黑体';">[{{o.nDate}}] {{o.nTitle}}</router-link>-->
<!--                </el-link>-->
<!--            </div>-->
<!--           <div style="position:absolute;bottom: 0">-->
<!--               <img class="click" src="@/assets/img/pic050.gif" alt="" />-->
<!--               <span><a href="/#/information">更多...</a></span>-->
<!--           </div>-->
<!--       </div>-->
  </div>

</template>
<script>
// import NavComponent from "@/components/nav/Nav";
// import HeaderComponent from "@/components/header/Header";
// import ContentTwoConponent from "@/components/contenttwo/ContentTwo";
// import FooterConponent from "@/components/footer/Footer";
// import newsItems from "@/components/contentone/newsItems";
export default {
    name:"ContentOneComponent",
  components: {
  // newsItems
  },
    data(){
        return{
          //lunbotu2数据
          List:[{nPic:""}],
          // news:[],
          news:[{title:"hhhhh",createAt:'2020',authorId:1},{nDate:"2022",title:"hhhhh",creatAt:'2020',authorId:1},{nDate:"2022",title:"hhhhh",creatAt:'2020',authorId:1}],

          // notice:[],
            // information:[]
        }
    },
    methods:{
        getAllNews(){
          this.$axios.get("/article/download/picList").then((res)=>{
            if(res.data.data.length == 0){
              this.List[0].nPic="https://tse1-mm.cn.bing.net/th/id/OIP-C.TqaaGAe_aQdZZxTwHNGcxgHaGs?pid=ImgDet&rs=1";
            } else{
              this.List = res.data.data;
              let url=this.$axios.defaults.baseURL;
              for (let i = 0; i < this.List.length ; i++) {
                this.List[i].nPic =url+"/file/img/"+ this.List[i].nPic
              }
            }
          });
        },
        getAll(){
            this.$axios.get("/article/article/articleList").then((res)=>{

              this.news=res.data.data;
              if(res.data.data.length == 0){
              this.news[0].pic="https://tse1-mm.cn.bing.net/th/id/OIP-C.TqaaGAe_aQdZZxTwHNGcxgHaGs?pid=ImgDet&rs=1";
            } else{
              // this.List = res.data.data;
              let url=this.$axios.defaults.baseURL;
              for (let i = 0; i < this.news.length ; i++) {
                this.news[i].pic =url+"/article/article/download/"+this.news[i].pic+"?filePath=articles&fileName="+ this.news[i].pic
              //   console.log("pic!!")
              // console.log(this.news[i])
             }
            }
            });
        }
    },
    mounted() {
        this.getAll();
        // this.getAll("通知",2);
        // this.getAll("重要信息",3);
        // this.getAllNews();
    }
}
</script>
<style>
    .lunbotu2 {
      width: 300px;
      float: left;
      margin-left: 0px;
    }
    .content1{
    margin-top: 0px;
    height: 220px;
  }
  .message{
      /*width: 290px;*/
      /*height: 210px;*/
      margin: 0 15px;
      /*float: left;*/
      /*text-align: left;*/
      position:relative;
  }
  .message span{
      font-size: 12px;
  }
 .arrow{
    margin-left: 13px;
 }
 .click2 {
  margin-left: 125px;
 }
 .paw {
    font-size: 13px;
    margin-top: 2px;
 }
  .paw input{
    width: 80px;
    height: 12px;
 }
 #pwd {
  margin-left: 11px;
  padding-right: 3px;
 }


 #dl button{
  width: 40px;
  font-size: 12px;
  height: 18px;
  padding-bottom: 16px;
margin: 6px auto 0;
display: block;
 }

 .ftp{
  margin-top: 55px;
  display: flex;
  justify-content: center;
 }
    /*轮播图2*/
    /*.el-carousel__item{*/
    /*  width: 80%;*/
    /*  left: -15%;*/
    /*}*/

    .news-item{
      float: left;
      width: 340px;
      margin-left: 50px;
      height:150px
    }
    /*.el-carousel--horizontal{*/
    /*  width: 300px;*/
    /*}*/
    .el-carousel__item h3 {
      color: #475669;
      font-size: 14px;
      opacity: 0.75;
      line-height: 150px;
      margin: 0;
    }

    .el-carousel__item:nth-child(2n) {
      background-color: #99a9bf;
    }

    .el-carousel__indicator--horizontal{
      padding: 0px
    }

    .el-carousel__item:nth-child(2n+1) {
      background-color: #d3dce6;
    }
    .mainContent{
      white-space: normal;
      text-align: left;
      font-family: cursive;
    }
  .router{
    font-family: Arial,Helvetica,sans-serif;
    font-size: 1.2em;
    vertical-align: middle;
    font-weight: normal;
  }
</style>
